﻿using UnityEngine;

// 根据鼠标移动旋转相机
public class Camerafollow : MonoBehaviour
{
    private float moveSpeed;
    void Start()
    {
        moveSpeed = 60f; //移动速度
    }

    void Update()
    {
        Vector3 angle = Vector3.zero;

        angle.x = transform.localEulerAngles.x - Input.GetAxis("Mouse Y") * moveSpeed * Time.deltaTime;
        angle.y = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * moveSpeed * Time.deltaTime;

        transform.localEulerAngles = angle;
    }
}